The technology described herein relates to a method of and apparatus for storing data in memory in data processing systems, and in particular to such a method and apparatus for use to store texture data and frame buffer data in computer graphics processing systems.
It is common in computer graphics systems to generate colours for sampling positions in the image to be displayed by applying so-called textures or texture data to the surfaces to be drawn. For example, surface detail on objects may be generated by applying a predefined “texture” to a set of polygons representing the object, to give the rendered image of the object the appearance of the “texture”. Such textures are typically applied by storing an array of texture elements or “texels”, each representing given texture data (such as colour, luminance, and/or light/shadow, etc. values), and then mapping the texels onto the corresponding elements, such as (and, indeed, typically) a set of sampling positions, for the image to be displayed. The stored arrays of texture elements (data) are typically referred to as “texture maps”.
Such arrangements can provide high image quality, but have a number of drawbacks. In particular, the storage of the texture data and accessing it in use can place, e.g., high storage and bandwidth requirements on a graphics processing device (or conversely lead to a loss in performance where such requirements are not met). This is particularly significant for mobile and handheld devices that perform graphics processing, as such devices are inherently limited in their, e.g., storage, bandwidth and power resources and capabilities.
It is known therefore to try to store such texture data in a “compressed” form so as to try to reduce, e.g., the storage and bandwidth burden that may be imposed on a device.
A further consideration when storing texture data (whether compressed or not) for use in graphics processing is that typically the graphics processing system will need to be able to access the stored texture data in a random access fashion (as it will not be known in advance which part or parts of the texture map will be required at any particular time). This places a further constraint on the storage of the texture data, as it is accordingly desirable to be able to store the texture data in a manner that is suitable for (and efficient for) random access to the stored data. This problem can be exacerbated where the size of the stored texture data in memory can vary, e.g. because the compression rate applied to the texture data is variable.
One way to facilitate random access to texture data is to store the texture data in memory on a block-by-block basis, at fixed memory locations, with each block being allocated sufficient memory space to store the maximum size any block to be stored could require (after any compression). However, the Applicants have recognised that this could be relatively wasteful of memory space, e.g., if not all blocks were to require the maximum possible memory space.
The Applicants accordingly believe that there remains scope for, and a need for, more efficient arrangements for storing data, such as texture data for use in graphics processing, in memory.